package com.java.day09.homework.test;

class Player {
    String name;
    int health;
    int attackPower;

    Player(String name, int health, int attackPower) {
        this.name = name;
        this.health = health;
        this.attackPower = attackPower;
    }

    boolean isAlive() {
        return health > 0;
    }

    void takeDamage(int damage) {
        health -= damage;
    }

    public String toString() {
        return "Player{" +
                "name='" + name + '\'' +
                ", health=" + health +
                ", attackPower=" + attackPower +
                '}';
    }
}